
/********************************
	Macors which inline assembly
 ********************************/
 
// Saves the value of esp to var
// #define STORE_ESP(var) 	asm("movl %%esp, %0;" : "=r" ( var ))

// Loads the contents of var into esp
// #define LOAD_ESP(var) 	asm("movl %0, %%esp;" : : "r" ( var ))

// Calls the function func
// #define CALL(addr)		asm("call *%0;" : : "r" ( addr ))

// Pushes the contents of var to the stack
// #define PUSH(var)		asm("movl %0, %%edi; push %%edi;" : : "r" ( var ))
////same for ebp
// Saves the value of ebp to var
// #define STORE_EBP(var) 	asm("movl %%ebp, %0;" : "=r" ( var ))

// Loads the contents of var into ebp
// #define LOAD_EBP(var) 	asm("movl %0, %%ebp;" : : "r" ( var ))





#define MAX_STACK_SIZE 4000
// #define MAX_MUTEXES 64
// #define MAX_CONDS 64

/********************************
	The API of the KLT package
 ********************************/

// int kthread_create( void*(*start_func)(), void* stack, unsigned int stack_size ); 
// int kthread_id();
// void kthread_exit();
// int kthread_join( int thread_id );
// 
// int kthread_mutex_alloc();
// int kthread_mutex_dealloc( int mutex_id );
// int kthread_mutex_lock( int mutex_id );
// int kthread_mutex_unlock( int mutex_id );
// 
// int kthread_cond_alloc();
// int kthread_cond_dealloc( int cond_id );
// int kthread_cond_wait( int cond_id, int mutex_id );
// int kthread_cond_signal( int cond_id );